package com.yootk.lombok;

import lombok.SneakyThrows;

/**
 * 异常处理
 */
public class MessageHandle {

    /*public static void print(String message) {
        if (message == null) {
            try {
                throw new Exception("传递的message参数内容为空，你疯了吗？");
            } catch (Exception e) {}
        }
        System.out.println(message.toUpperCase());
    }*/

    @SneakyThrows   // 会自动生成try/catch
    public static void print(String message) {
        if (message == null) {
            throw new Exception("传递的message参数内容为空，你疯了吗？");
        }
        System.out.println(message.toUpperCase());
    }
}
